import request from "@/axios"
import { ResponseData } from "../../../../constants"


enum Api {
  permissionMetaTree = "/permission/Tree",
  savePermission = "/permission/save",
  removePermission = "/permission/remove",
}


export const permissionApi = {
  permissionMetaTree: () => {
    return request.get<ResponseData>(Api.permissionMetaTree)
  },
  savePermissionApi: (params: any) => {
    return request.post<ResponseData>(Api.savePermission, params)
  },
  removePermissionApi: (id: string) => {
    return request.get<ResponseData>(Api.removePermission, { id })
  }
}